package com.wanshi.entity;

import com.alibaba.fastjson.JSON;

import java.util.ArrayList;
import java.util.List;

public class City {

    public static void main(String[] args) {
        List<City> list = new ArrayList<>();
        City city = new City(1,"哈尔滨","haerbin");
        City city2 = new City(2,"沈阳","shenyang");
        City city3 = new City(3,"吉林","jilin");

        list.add(city);
        list.add(city2);
        list.add(city3);


        String ss = JSON.toJSONString(list);

        //{"id":1,"name":"","zhi":"haerbin"}
        System.out.println(ss);

    }

    private int id;

    private String name;

    private String zhi;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getZhi() {
        return zhi;
    }

    public void setZhi(String zhi) {
        this.zhi = zhi;
    }

    public City(int id, String name, String zhi) {
        this.id = id;
        this.name = name;
        this.zhi = zhi;
    }

    public City() {
    }
}
